package com.t9;
import static net.mindview.util.Print.*;
/**
 * Created by xuyiwei on 2018/7/21.
 */
interface Interface1 {
    void f1();
    void g1();
}
interface Interface2 {
    void f2();
    void g2();
}
interface Interface3 {
    void f3();
    void g3();
}
interface Multiple
        extends Interface1, Interface2, Interface3 {
    void h();
}

abstract class Abstract {
    String s;
    public Abstract(String s) { this.s = s; }
    abstract void af();
}

class All extends Abstract implements Multiple {
     All() { super("All"); }
    public void h() { print("All.h"); }
    public void f1() { print("All.f1"); }
    public void g1() { print("All.g1"); }
    public void f2() { print("All.f2"); }
    public void g2() { print("All.g2"); }
    public void f3() { print("All.f3"); }
    public void g3() { print("All.g3"); }
    @Override
    void af() {
        print("All.af");
    }
}
public class E14_InterfaceInheritance {
    static void takes1(Interface1 i) {
        i.f1();
        i.g1(); }
    static void takes2(Interface2 i) {
        i.f2();
        i.g2(); }
    static void takes3(Interface3 i) {
        i.f3();
        i.g3(); }
    static void takesAs(Abstract a) {
        a.af();
    }
    static void takesAll(All a) {
        a.f1();
        a.g1();
        a.f2();
        a.g2();
        a.f3();
        a.g3();
        a.h();
    }
    public static void main(String args[]) {
        All a = new All();
        takes1(a);
        takes2(a);
        takes3(a);
        takesAs(a);
        takesAll(a);
    }
}